<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <title>第一种头部</title>
    <link rel="stylesheet" type="text/css" href="../../../css/api.css" />
    <link rel="stylesheet" type="text/css" href="../../../css/aui.css" />
    <style>
        html,
        body {
            width: 100%;
            min-height: 100vh;
            background: #000;
            line-height: 1;
        }
    </style>
</head>

<body>

</body>
<script type="text/javascript" src="../../../script/api.js"></script>
<script type="text/javascript" src="../../../script/jquery.min.js"></script>
<script type="text/javascript">
    apiready = function() {

        var photoBrowser = api.require('photoBrowser');
        photoBrowser.open({
            images: api.pageParam.imgs_arr,
            placeholderImg: 'widget://res/img/apicloud.png',
            bgColor: 'rgba(0,0,0,0)'
        }, function(ret, err) {
            if (ret) {
                console.log(JSON.stringify(ret));
                if(ret.eventType=='change'){
                  setTimeout(function(){
                    api.execScript({
                        frameName: 'look_img_frm',
                        script: 'changeIndex('+(ret.index+1)+');'
                    });
                  },200)
                }
            } else {
                alert(JSON.stringify(err));
            }
        });

        photoBrowser.setIndex({
            index:api.pageParam.img_index-1
        });


        api.openFrame({
            name: 'look_img_frm',
            url: '../look_img_frm.html',
            rect: {
                x: 0,
                y: 0,
                w: 'auto',
                h: 75
            },
            pageParam: {
                imgs_num: api.pageParam.imgs_arr.length,
                img_index: api.pageParam.img_index
            },
            bounces: true,
            bgColor: 'rgba(0,0,0,0)',
            vScrollBarEnabled: true,
            hScrollBarEnabled: true
        });


    };


    // 关闭当前窗口
    function close_win() {
        api.closeWin({});
    }
</script>

</html>
